

#ifndef __COND_HPP__
#define __COND_HPP__

#include <pthread.h>

class Cond
{
public:
    Cond()
    {
        pthread_cond_init(&cond_ , nullptr );
    }
    void Wait(pthread_mutex_t& mutex)
    {
        pthread_cond_wait(&cond_ , &mutex);
    }

    void Notify()
    {
        pthread_cond_signal(&cond_);
    }

    void NotifyAll()
    {
        pthread_cond_broadcast(&cond_);
    }
private:
    pthread_cond_t cond_;
};


#endif